﻿using System.Collections;
using System.Collections.Generic;
using BearUtil.Hidden;
using Sirenix.OdinInspector;
using UnityEngine;
namespace BearUtil
{
	[CreateNodeMenu("自定义节点/角色头顶表情"), Title("角色头顶表情"), NodeTintAttribute("#39930C")]
	public class ShowEmoji : BearNode
	{
		[LabelText("节点类型"), HideInInspector]
		public int type = 19;
		[SerializeField, HideLabel, ValueDropdown("GetActors"), OnValueChanged("setRoleId")]
		public ActorData _actor;
		private ActorData[] GetActors()
		{
			var storyGraph = ((graph as DialogGraph)?.owner.graph as StoryGraph);
			if (storyGraph != null)
			{
				var series = StoriesSetting.Instance.FindSeriesByStoryGraph(storyGraph);
				return series.Actors.ToArray();
			}
			return new ActorData[0];
		}

		[LabelText("角色的map_item_id")]

		public int map_item_id;
		private void setRoleId(ActorData actor)
		{
			map_item_id = _actor.role_id;
		}
		[HideLabel, ValueDropdown("Getemoji", DropdownWidth = 300), OnValueChanged("Setemoji")]
		public string _value_emoji;
		[LabelText("表情样式"), HideInInspector]
		public string expression_name;
		public void Setemoji (string propDesc) => expression_name = CreateNewProperty.Instance.GetPropertyContent("emoji", _value_emoji).StringParam;
		public List<string> Getemoji () 
{ return CreateNewProperty.Instance.GetPropertyContentDesc("emoji"); }
		public override bool isSaved { get => true; } 
	}
}
